package com.blackbird.jang.model;

import com.blackbird.jang.MainActivity;
import com.wiyun.engine.nodes.Node;
import com.wiyun.engine.nodes.Sprite;
import com.wiyun.engine.utils.TargetSelector;

/**
 * 互换棋子
 * 
 * @author jang
 * 
 */
public class InterchangeButton extends ToolButton {

	public InterchangeButton(Node normalSprite, Node selectedSprite,
			Node disabledSprite, Node focusedSprite, TargetSelector selector) {
		super(normalSprite, selectedSprite, disabledSprite, focusedSprite,
				selector);

		setPosition(180 * MainActivity.SCALE_X, 750 * MainActivity.SCALE_Y);
	}

	public static InterchangeButton make(int normalResId, int selectedResId,
			int disabledResId, int focusedResId, Node target, String selector) {

		return new InterchangeButton(
				Sprite.make(normalResId),
				selectedResId != 0 ? ((Node) (Sprite.make(selectedResId)))
						: null,
				disabledResId != 0 ? ((Node) (Sprite.make(disabledResId)))
						: null,
				focusedResId != 0 ? ((Node) (Sprite.make(focusedResId))) : null,
				new TargetSelector(target, selector, null));
	}

	/**
	 * 棋子互换位置
	 */
	public void onAction() {
		// GameLayer.isInterchanging = !GameLayer.isInterchanging;
		//
		// if (GameLayer.isInterchanging) {
		// GameLayer.isExploding = false;
		// GameLayer.isColorchanging = false;
		//
		// sparkle();
		// } else {
		// reset();
		// }

		//
		// if (selectedBlock == null) {
		// return;
		// }
		//
		// interchangeBlock = selectedBlock;
	}

}
